import Vue from 'vue'
import Router from 'vue-router'
import components from 'src/router/components.js'
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/index',
      name: 'index',
      component: components.index
    },
    {
      path: '/search',
      name: 'search',
      component: components.search
    },
    {
      path: '/newProduct',
      name: 'newProduct',
      component: components.newProduct
    },
    {
      path: '/productDetail/:productId',
      name: 'productDetail',
      component: components.productDetail
    }
    ,
    {
      path: '/coupon/:forPage/:id',
      name: 'coupon',
      component: components.coupon,
    },
    {
      path: '/my',
      name: 'my',
      component: components.my
    },
    {
      path: '/productCar',
      name: 'productCar',
      component: components.productCar
    },
    {
      path: '/addressAdd/:index',
      name: 'addressAdd',
      component: components.addressAdd
    },
    {
      path: '/addressManage/:changeCheck',
      name: 'addressManage',
      component: components.addressManage
    },
    {
      path: '/myPoint',
      name: 'myPoint',
      component: components.myPoint
    },
    {
      path: '/orderList/:orderType',
      name: 'orderList',
      component: components.orderList,
    },
    {
      path: '/evaluate/:orderId',
      name: 'evaluate',
      component: components.evaluate,
    },
    {
      path: '/orderDetail/:id',
      name: 'orderDetail',
      component: components.orderDetail,
    },
    {
      path: '/goPay/:orderId',
      name: 'goPay',
      component: components.goPay,
    },
    {
      path: '/sureOrder',
      name: 'sureOrder',
      component: components.sureOrder,
    },
    {
      path: '/comPages/:id',
      name: 'comPages',
      component: components.comPages,
    },{
      path: '*',
      name: 'other',
      redirect:'/index'
    }
  ]
})
